﻿using CeremonyBackground.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CeremonyBackground.Infrastructure.EntityConfigurations
{
    public class BobingPrizeResultEntityTypeConfiguration
    : IEntityTypeConfiguration<BobingPrizeResult>
    {
        public void Configure(EntityTypeBuilder<BobingPrizeResult> builder)
        {
            builder.ToTable("BobingPrizeResult");

            builder.HasKey(ci => ci.Id);

            builder.Property(ci => ci.Id)
               .UseHiLo("bobingresult_hilo")
               .IsRequired();

            builder.Property(cb => cb.UserId)
                .IsRequired(true);
            builder.Property(cb => cb.BobingPrizeId)
               .IsRequired(true);
            builder.Property(cb => cb.PrizeResult)
                .IsRequired(true)
                .HasMaxLength(100);
            builder.Property(cb => cb.CreateTime)
               .IsRequired(true);

        }
    }
}
